<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <div id="d_main">
      <xsl:for-each select="Categories/Category/Category">
        <xsl:sort select="@text"/>
        <div style="width:120px;cursor:pointer;float:left;" class="dropmenuitem" onclick="OpenSubMenu(this);">
          <xsl:attribute name="id">
            <xsl:value-of select="@id"/>
          </xsl:attribute>
          <xsl:attribute name="title">
            <xsl:value-of select="@text"/>
          </xsl:attribute>
          <img>
            <xsl:attribute name="src">
              <xsl:value-of select="@image"/>
            </xsl:attribute>
          </img>
          <xsl:value-of select="@text"/>
        </div>
      </xsl:for-each>
    </div>
    <xsl:for-each select="Categories/Category/Category">
      <div style="display:none;" class="submenuitem">
        <xsl:attribute name="id">
          <xsl:value-of select="concat('s_',@id)"/>
        </xsl:attribute>
        <div align="right" style="cursor:pointer;padding-right:5px;" title="Back" class="dropmenuitem" onclick="BackMenu();">
          Back
        </div>
        <xsl:for-each select="Category">
          <xsl:sort select="@text"/>
          <div style="width:120px;cursor:pointer;float:left;" onclick="SelectMenu(this);">
            <xsl:attribute name="id">
              <xsl:value-of select="@id"/>
            </xsl:attribute>
            <xsl:attribute name="title">
              <xsl:value-of select="@text"/>
            </xsl:attribute>
            <img>
              <xsl:attribute name="src">
                <xsl:value-of select="@image"/>
              </xsl:attribute>
            </img>
            <xsl:value-of select="@text"/>
          </div>
        </xsl:for-each>
      </div>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

